#! /usr/bin/env python
# -*- coding: utf-8 -*-
'''

@todo 自动化程序入口
@Author : sunp
@Date :2021/11/21
'''
from apscheduler.schedulers.blocking import BlockingScheduler
from app import App

def entry():
    app = App()
    scheduler = BlockingScheduler(timezone = 'Asia/Shanghai')
    '''每天早晨7:00自动签到开宝箱'''
    # scheduler.add_job(id = 'sign in',func= app.signIN,trigger='cron',hour = 7)
    # 睡觉开宝箱
    scheduler.add_job(id = 'sleep',func= app.sleep)
    # 吃饭开宝箱
    # scheduler.add_job(id = 'eat',func= app.eat)
    # 自动阅读
    # scheduler.add_job(id = 'autoreader',func= app.read)
    try:
        scheduler.start()
    except(Exception):
        print(u'番茄免费阅读小说python自动化异常结束')
        print(Exception)
    scheduler.shutdown()


if __name__ == '__main__':
    entry()